package com.example.eurekajob.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @version 1.0.0
 * @className: ConfigTestController
 * @description: 测试Config配置文件
 * @author: zhangjunfa
 * @date: 2022/6/16 17:03
 */
@RestController
@RefreshScope
public class ConfigTestController {
    @Value("${version}")
    private String version;
    @Value("${spring.cloud.config.name}")
    private String configName;

    @GetMapping("/testConfig")
    public String testConfig() {
        return "当前的版本是：" + version + " 配置文件名称是:" + configName;
    }
}
